<?php
class financeModel extends Model
{
    protected 	$_validate=array(
        array("amount","require","金额不能为空"),
        array("agreementid","require","订单ID不能为空"),
        array("cid","require","请选择业务员"),
        array("feename","require","请选择费用类型"),
        array("thedate","require","日期不得为空"),
    );

    protected $_auto = array (
        array('type','1'),  // 新增的时候把status字段设置为1
        array('createdate','getTime',1,'callback'), // 对create_time字段在更新的时候写入当前时间戳
    );
    public  function getTime()
    {
        return date("Y-m-d H:i:s");
    }
}
?>